<?php
include_once('connection/connection.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/ajaxFunction_sp_detail.js"></script>
<script type="text/javascript" src="js/ajaxFunction_q1_new.js"></script>
<script language="javascript" src="js/cal2.js">
/*
Xin's Popup calendar script-  Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="js/cal_conf2.js"></script>


<style type="text/css">
<!-- end face file -->

<!--
.heading_bgclr{
background-color:#CCCCCC;
}
.section_heading
{
	border:#666666 1px solid;
	width:780px;
	height:22px;
	color:#FFFFFF;
	font-size:12px;
	font-weight:600;
	font-family:arial;

}
.section_format
{
	background:#FFFFFF;
	width:1000px;
}
.section_format table
{
	border-collapse:collapse;
	border-color:#666666;
	background-color:#EEEEEE;
	width:1000px;
}
.section_format
{
	font-size:8.5pt;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	color:#000000;
}
.section_format td
{
	height:25px;
}
-->
</style>
</head>

<body>
  <div id="section4" class="section_format" align="center">
<table width="2000" style="width:2000px;" border="1" align="center">
  <tr>
    <td height="48" colspan="21" align="center" bgcolor="#CCCCCC"><b>Water Source Details</b></td>
  </tr>
  <tr bgcolor="#DADADA">
    <td width="50">Habitation Name</td>
    <td width="40">Type of Habitation</td>
    <td width="40">Location</td>
    <td width="40">Latitude</td>
    <td width="40">Longitude</td>
    <td width="50">Functional Status</td>
    <td width="50">Operational Status</td>
    <td width="50">Quality Status</td>
    <td width="27">Yield</td>
    <td width="50">Seasonal Fluctuation in Yield</td>
    <td width="50">Water Table Fluctuation (m) Min</td>
    <td width="50">Water Table Fluctuation (m) Max</td>
	  <td width="15">pH</td>
	  <td width="15">TDS</td>
	  <td width="15"> CL </td>
	  <td width="15">F</td>
	  <td width="15">No3</td>
	  <td width="40">Repairable Status</td>
	  <td width="40">Remarks</td>
	  <td width="40">Action</td>
  </tr>
  <tbody id="handpump_content">
  <?php
  $sql = mysql_query("SELECT * FROM tbl_dtls_hp_details_q1 WHERE loc_id = '$_REQUEST[id]' AND hp_sp = 'SP' ");
  while($fetch_row = mysql_fetch_assoc($sql)){
  ?>
    <tr id="hp_row_<?php echo $fetch_row['id']; ?>" class="hp_row">
    <td><?php  echo $fetch_row['habitation_name']; ?></td>
    <td><?php  echo $fetch_row['type_of_habitation']; ?></td>
    <td><?php  echo $fetch_row['location']; ?></td>
    <td><?php  echo $fetch_row['latitude']; ?></td>
    <td><?php  echo $fetch_row['longitude']; ?></td>
    <td><?php  echo $fetch_row['functional_status']; ?></td>
    <td><?php  echo $fetch_row['operational_status']; ?></td>
    <td><?php  echo $fetch_row['quality_status']; ?></td>
    <td><?php  echo $fetch_row['yeild']; ?></td>
    <td><?php  echo $fetch_row['sea_fluct_yeild']; ?></td>
    <td><?php  echo $fetch_row['water_table_fluct_min']; ?></td>
	<td><?php  echo $fetch_row['water_table_fluct_max']; ?></td>
    <td ><?php  echo $fetch_row['ph']; ?></td>
    <td ><?php  echo $fetch_row['tds']; ?></td>
    <td ><?php  echo $fetch_row['cl']; ?></td>
    <td ><?php  echo $fetch_row['f']; ?></td>
    <td ><?php  echo $fetch_row['no3']; ?></td>
    <td ><?php  echo $fetch_row['repairable_status']; ?></td>
    <td ><?php  echo $fetch_row['remark']; ?></td>
    <td align="center"><a href="Javascript:void(0);" style="text-decoration:none; color:#000000;" onclick="hp_edit('<?php echo $fetch_row["id"]; ?>');" ><b>Edit</b></a>
	&nbsp;&nbsp;<a href="Javascript:void(0);" style="text-decoration:none; color:#000000;" onclick="hp_delete('<?php echo $fetch_row["id"]; ?>');" ><b>Delete</b></a>
	
	
	</td>
  </tr>
  <?php
  }
  ?>
  </tbody>
</table>
</div>
<div style="position:fixed; height:20px; width:100px; text-align:center; padding-top:5px; top:0px; left:500px; background-color:#FDFD00; color:#1F1F1F; border:1px solid #CCFF00; font-family:Arial; font-size:8.5pt; font-weight:bold;" id="loading"></div>
<div style="width:900px"><a href="Javascript:void(0);" id="add_new_link" style="text-decoration:none;" onclick="toogle_form();" ><img src="images/add_new.jpg" border="0" /></a></div>
<br /><br />
<div id="edit_mode" align="center" style="width:900px">
<form method="post" id="sampleform" name="sampleform" onsubmit="return hp_detail_val();" >
<input type="hidden" name="hp_id" id="hp_id"  value="" />
<input type="hidden" name="loc_id" id="loc_id" value="<?php echo $_REQUEST['id']; ?>" />
<table border="0" width="469" style="font-family:verdana; font-size:8.5pt; border:1px solid #000000; border-top:none;" cellspacing="0">
<tr>
  <td height="40" colspan="2" align="right"  bgcolor="#CCCCCC" ><b>SP Detail</b>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><a href="Javascript:void(0);" style="text-decoration:none; color:#000000;" onclick="close_event();" ><img src="images/b_drop.png" title="close" width="15" border="0" height="15"></a></b></td>
  </tr>
 <tr height="26"><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td width="247" height="28">Habitation Name</td><td width="236">
<select name="habitation_name" id="habitation_name">
<option value="0" >Select Habitation</option>
<?php 
  
	  $result=mysql_query("SELECT DISTINCT habit_code,habit_name from tbl_dtls_q1_oh where loc_id='$_REQUEST[id]' order by id");	

	  while(list($id,$name)=mysql_fetch_array($result))
		 	{       
             	 echo "<option value=\"$id,$name\">$name</option>";
         	}
			?>	 
</select></td></tr>
<tr>
  <td height="28">Type of Habitation </td>
  <td >  <select name="habit_type" id="habit_type">
	  <option value="MH">MH</option>
	  <option value="OH">OH</option>
	  </select></td>
</tr>

<tr>
  <td height="25">&nbsp;Location</td>
  <td><input type="text" name="location" id="location" /></td>
</tr>
<tr>
  <td height="26">&nbsp;Latitude</td>
  <td><input type="text" name="latitude" id="latitude" onBlur="float1(this,20,32);"  /></td>
</tr>
<tr>
  <td height="26">&nbsp;Longitude</td>
  <td><input type="text" name="longitude" id="longitude" onBlur="float1(this,67,80);" /></td>
</tr>

<tr>
  <td height="26">&nbsp;Functional Status </td>
  <td><input type="radio" name="function_status" id="function_on" value="FUNCTIONAL" onClick="show_NF();" checked="checked"/>Functional
	 <input type="radio" name="function_status" id="function_off" value="NOT FUNCTIONAL" onClick="show_NF();"/>Not Functional		</td>
</tr>
<tbody id="func">
<tr>
  <td height="26">&nbsp;Operational Status </td>
  <td><input type="radio" name="opration_status" id="opration_status_in" value="In Use" checked="checked">In Use
	  <input type="radio" name="opration_status" id="opration_status_out" value="Out of Use">Out Use</td>
</tr>
<tr>
  <td height="26">&nbsp;Quality Status </td>
  <td><input type="radio" name="quality_status" id="quality_status_port" value="Potable" checked="checked">
  Potable
	  <input type="radio" name="quality_status" id="quality_status_not" value="Not Potable">
	  Non Potable</td>
</tr>
<tr>
  <td height="26">&nbsp;Yield</td>
  <td><input type="radio" name="yield" id="yield_good" value="Good" checked="checked">Good
	  <input type="radio" name="yield" id="yield_satis" value="Satisfactory">Satisfactory
	   <input type="radio" name="yield" id="yield_poor" value="Poor">Poor</td>
</tr>
<tr>
  <td height="26">&nbsp;Seasonal Fluctuation in Yield </td>
  <td><input type="radio" name="seasonal_flunctuation" id="seasonal_flunctuation_no" value="No Change" checked="checked">No Change
	  <input type="radio" name="seasonal_flunctuation" id="seasonal_flunctuation_slight" value="Slight Change">Slight Change
	  <input type="radio" name="seasonal_flunctuation" id="seasonal_flunctuation_drastic" value="Drastic Change">Drastic Change</td>
</tr>
<tr>
  <td height="26">&nbsp;Water Table Fluctuation (m) Min</td>
  <td><input type="text" name="fluctuation_min" id="fluctuation_min"  /></td>
</tr>
<tr>
  <td height="24">&nbsp;Water Table Fluctuation (m) Max</td>
  <td><input type="text" name="fluctuation_max" id="fluctuation_max"  /></td></tr>
<tr height="30" bgcolor="#666666">
  <td colspan="2">&nbsp;<b>Water Quality Parameter</b></td>
  <td></td>
</tr>
<tr>
  <td>&nbsp;pH</td>
  <td>&nbsp;
      <input type="text" name="ph" id="ph"  value="" onBlur="check1(this,6,10);"/></td>
  <td></td>
</tr>
<tr>
      <td>&nbsp;TDS (mg/l)</td>
      <td>&nbsp;<input type="text" name="tds" id="tds"   value="" onBlur="check(this,100,40000);"/></td>
      </tr>
	  <tr>
      <td>&nbsp;CL (mg/l)</td>
      <td>&nbsp;<input type="text" name="cl" id="cl"  value="" onBlur="check(this,50,15000);"/></td>
      </tr>
	  <tr>
      <td>&nbsp;F (mg/l)</td>
      <td>&nbsp;<input type="text" name="f" id="f"  value="" onBlur="check1(this,0,18);"  /></td>
      </tr>
	  <tr>
      <td>&nbsp;NO3 (mg/l)</td>
      <td>&nbsp;
        <input type="text" name="no3" id="no3"  value="" onblur="check(this,0,2500);"/ /></td>
      </tr>
	    <tr>
      <td>&nbsp;Date</td>
      <td>&nbsp;<input type="text" name="date" id="firstinput" value="" />&nbsp;<a href="javascript:showCal('Calendar1')"><img src="images/caldr.jpg" /></a></td></td>
      </tr>
	  </tbody>
	  <tbody id="non_func" hidden>
	  <tr>
      <td>&nbsp;Non Functional Status</td>
      <td>&nbsp;
        <input type="radio" name="Repairable" id="Repairable1" value="Repairable" checked="checked" />Repairable
	  <input type="radio" name="Repairable" id="Repairable2" value="Non Repairable" />Non Repairable
	  <input type="radio" name="Repairable" id="Repairable3" value="Abondoned" />
	  Abandoned	      </td>
  </tr>
  
	   <tr>
      <td>&nbsp;Remarks</td>
      <td>&nbsp;<input type="text" name="remarks" id="remarks" value=""/>	  </td>
      </tr>
	  </tbody>
<tr><td height="35" colspan="2" align="center"><input type="Submit" id="submit_form" value="Add SP" /><td></td></tr>
</table>
</form>
</div>


</body>
</html>
